package com.fenghongzhang.day012;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MyReceiver4 extends BroadcastReceiver {

    private static final String TAG = "MyReceiver4";
    @Override
    public void onReceive(Context context, Intent intent) {
        //广播的频道
        String action = intent.getAction();
        if(action.equals(Intent.ACTION_USER_PRESENT)){
            Log.i(TAG, "onReceive: 屏幕亮了");
        }else if(action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)){
            Log.i(TAG, "onReceive: 关闭或者打开飞行模式");
        }
    }
}
